package org.qqcui.designpattern.patterns.composite;

/**
 * 组织机构组件抽象类
 *
 * @author cuiqingqiang
 * @version 1.0
 * @date 2022/4/29 15:27
 **/
public abstract class OrganizationComponent {

    /**
     * 名称
     */
    private String name;

    /**
     * 描述
     */
    private String desc;

    public OrganizationComponent(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }

    protected void add(OrganizationComponent org) {
        throw new UnsupportedOperationException();
    }

    protected void remove(OrganizationComponent org) {
        throw new UnsupportedOperationException();
    }

    protected abstract void print();

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
